<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改页面</title>
</head>
<body>
<form action="NewsEditServlet" method="post">
	
		导航栏：<select name="channel_id" id="channel_id">
		<c:forEach var="newsChannellist" items="${newsChannellist}">
		<option value="${newsChannellist.id}">${newsChannellist.name}</option>
		</c:forEach>
		</select>
		<br/>
		<input type="hidden" name="id" value="${news.id}">
	标题：<input type="text" name="title" value="${news.title}"><br/>
	 <label>链接：  <input type="radio" value="0" name="linktype" id="linkone" onclick="show(0)" >内连接</label>
			<label><input type="radio" value="1"  name="linktype" id="linktwo" onclick="show(1)" >外链接</label><br>
	<br/>
	<label class="content">内容：<textarea name="content" id="content" cols="20" rows="5">${news.content}</textarea></label>
	<br/>					
	<label class="linkurl">地址：<input type="text" id="linkurl" value="${news.linkurl}" name="linkurl"></label>
	<br/>
	<input type="submit">
</form>
<script src="/static/asset/jqery/2.1.4/jquery.js"></script>
</body>
<script>
$(document).ready(function(){
	$('#channel_id').val(${news.channelId});
	if(${news.linktype}==0){
		show(0);
		$('#linkone').attr('checked',true);
	}else{
		show(1);
		$('#linktwo').attr('checked',true);
	}
});
function show(type){
	if(type==0){
		$('.content').show();
		$('.linkurl').hide();
	}else{
		$('.content').hide();
		$('.linkurl').show();
	}
}
</script>
</html>